package processor

import (
	"fmt"
	"mass-user/commons/message"
	"mass-user/commons/user"
)

var (
	UserOnlineMap map[int]*user.User = make(map[int]*user.User)
)

type UserMgr struct {
}

func ShowOnlineUser() {
	for id, user := range UserOnlineMap {
		fmt.Printf("id %v status: %v\n", id, user.UserStatus)
	}
}

func UpdateUserStatus(unser *message.NotifyUserStatusMes) {
	UserOnlineMap[unser.UserId] = &user.User{
		UserId:     unser.UserId,
		Pwd:        "",
		UserName:   "",
		UserStatus: unser.Status,
	}
	ShowOnlineUser()
}
